/*	Revision History	*/
/*	Bryan Christ - Inception:  Wed Nov  9 10:58:34 2005	*/

#ifndef _H_LIB_PSEUDO_
#define _H_LIB_PSEUDO_

#include <inttypes.h>
#include <stdint.h>

#define LIBPSEUDO_VERSION     "1.2.0"

/*	Shared Message Queue status codes	*/
enum
{
	SHMQ_OK = 0,
	SHMQ_QUEUE_INVALID,
	SHMQ_QUEUE_FULL,
	SHMQ_MSG_INVALID
};

/*	Pseudo Threads scheduler types		*/
enum
{
	PS_SCHED_LEAPFROG = 1
};


/*	Return codes for Pseuod Threads		*/
enum
{
	PSTHREAD_ERR = -1,
	PSTHREAD_CONTINUE,
	PSTHREAD_GROW,
	PSTHREAD_TERMINATE
};

typedef struct _ps_task_s	ps_task_t;
typedef struct	_ps_runq_s	ps_runq_t;

typedef int16_t (*PSTHREAD)(ps_task_t *task,void *anything);

ps_runq_t*  psthread_init(int8_t scheduler);
ps_task_t*  psthread_add(ps_runq_t *run_q,PSTHREAD callback,void *anything);
int8_t      psthread_del(ps_runq_t *run_q,ps_task_t *task);
void		psthread_run(ps_runq_t *run_q,uint16_t tasks);
uint16_t	psthread_count(ps_runq_t *run_q);

/*	shared message queue (shmq) functions	*/
int16_t		shmq_msg_put(const char *queue_name,void *anything);
void*       shmq_msg_get(const char *queue_name);
uint16_t	shmq_size(const char *queue_name);

#endif
